package com.study.mapper;

import com.study.model.entity.Class;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author Admin
 * @since 2021-11-22
 */
public interface ClassMapper extends BaseMapper<Class> {

    Class queryById(Long id);

    @ResultMap("mybatis-plus_Class")
    @Select("select * from t_class where id =#{id}")
    Class queryClassById(Long id);

    @Insert("insert into t_class(name,monitor) values (#{name},#{monitor,typeHandler=com.study.common.MonitorTypeHandler})")
    void save(Class cla);
}
